package main
import (
	"fmt"
	"time"
)

func main() {
	var date string
	fmt.Scanln(&date)
	t, _ := time.Parse("2006-01-02", date)
	fmt.Println(t.Weekday())
}